IF(APPLE)
  INCLUDE_DIRECTORIES(/sw/include)
ENDIF(APPLE)
IF(CMAKE_COMPILER_IS_GNUCXX)
  ADD_DEFINITIONS(-Drestrict=__restrict__ -DADD_)
  SET(CMAKE_CXX_FLAGS "-ftemplate-depth-60 -Drestrict=__restrict__ -O3 -fstrict-aliasing -funroll-all-loops   -finline-limit=1000 -ffast-math -Wno-deprecated")
  SET (FORTRAN_LIBS "-lg2c")
  SET(F77 g77)
  SET(F77OPTFLAGS  "-O3 -funroll-loops")
  SET(F77FLAGS ${F77OPTFLAGS})
ELSE(CMAKE_COMPILER_IS_GNUCXX)
  ADD_DEFINITIONS(-DADD_)
  SET(CMAKE_CXX_FLAGS "-restrict -unroll")
  SET(FORTRAN_LIBS "-lPEPCF90 -lCEPCF90 -lF90 -lintrins")
  SET(F77 ifc)
  SET(F77OPTFLAGS  "-fpp2 -O3")
  SET(F77FLAGS ${F77OPTFLAGS})
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
